package com.chengliang.bbs.mapper;

import org.apache.ibatis.annotations.Param;

/**
 * @author chengliang
 */
public interface ExperienceMapper {

    /**
     * 初始化经验表
     *
     * @param userId
     * @return
     */
    boolean init(Integer userId);

    /**
     * 增加经验值
     *
     * @param userId
     * @param experienceValue
     * @return
     */
    boolean addTotalExperience(@Param("userId") Integer userId, @Param("experienceValue") Integer experienceValue);


    /**
     * 减少、消耗经验值
     *
     * @param userId
     * @param experienceValue
     * @return
     */
    boolean reduceTotalExperience(@Param("userId") Integer userId, @Param("experienceValue") Integer experienceValue);

    /**
     * 查询经验值是否足够消费、支付
     *
     * @param userId
     * @param experience
     * @return
     */
    boolean checkExperienceEnough(@Param("userId") Integer userId, @Param("experience") Integer experience);


    /**
     * 通过回复主键查询帖子的悬赏经验
     * @param replyId
     * @return
     */
    Integer selectJieRewardValueByReplyId(Integer replyId);
}